package com.project2.mapper;

import com.project2.bean.vo.BeanInCategoryListInDataInWxCategoryIndexVo;
import com.project2.bean.vo.BeanInCurrentSubCategoryInDataInWxCategoryIndexVo;
import com.project2.bean.vo.CurrentCategoryInDataInWxCategoryIndexVo;
import com.project2.bean.po.MarketCategory;
import com.project2.bean.po.MarketCategoryExample;
import com.project2.bean.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MarketCategoryMapper {
    long countByExample(MarketCategoryExample example);

    int deleteByExample(MarketCategoryExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MarketCategory record);

    int insertSelective(MarketCategory record);

    List<MarketCategory> selectByExample(MarketCategoryExample example);

    MarketCategory selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MarketCategory record, @Param("example") MarketCategoryExample example);

    int updateByExample(@Param("record") MarketCategory record, @Param("example") MarketCategoryExample example);

    int updateByPrimaryKeySelective(MarketCategory record);

    int updateByPrimaryKey(MarketCategory record);

    List<ListInDataInAdminCategoryVo> queryListInDataInAdminCategoryVoByLevelAndDeleted(String firstLevel, Boolean deleted);

    List<ChildrenInListInDataInAdminCategoryVo> queryChildrenInListInDataInAdminCategoryVoByPidAndLevelAndDeleted(Integer id, String secondLevel, Boolean deleted);

    List<Category> selectCategoryIdAndName();

    DataInCategoryAddVo queryCategoryByNameAndDesc(String name, String desc);

    List<ListInDataInCategoryL1Vo> queryAllL1LevelCategoryInfoByLevel(String firstLevel);

    List<BeanInCategoryListInDataInWxCategoryIndexVo> queryL1LevelInfoByLevel(String firstLevel);

    CurrentCategoryInDataInWxCategoryIndexVo queryCurrentCategoryByMinidAndLevel(Integer minId, String firstLevel);

    List<BeanInCurrentSubCategoryInDataInWxCategoryIndexVo> queryCurrentSubCategoryListByPidAndLevel(Integer id, String secondLevel);

    int selectPidByCategoryId(Integer id);

    MarketCategory selectParentCategory(int pid);

    List<MarketCategory> selectCategory(@Param("pid") int pid, @Param("categoryId") Integer categoryId);

    List<MarketCategoryAndMarketGoods> selectCategoryIdAndNames();

    List<Brand> selectCategoryByPid(Integer pId);

    int selectCategoryPid(int categoryId);

    List<WxIndexChannel> selectChannel();

    List<Integer> getCategoryIdByCategoryId(Integer id);

    List<MarketCategory> selectAllCategory(int pid);

//    List<MarketCategory> selectCategorysByPid(int pid);

    List<Integer> selectCategoryIdByPid(int pid);
}